// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 编辑菜单信息 PUT /sys/menu */
export async function sysMenuControllerEdit(
  body: API.SysMenuUpdateForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/menu`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新建菜单信息 POST /sys/menu */
export async function sysMenuControllerSave(
  body: API.SysMenuForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/menu`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除菜单 DELETE /sys/menu */
export async function sysMenuControllerDelete(body: number[], options?: { [key: string]: any }) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/menu`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 列出菜单树 GET /sys/menu/routes */
export async function sysMenuControllerListRoutes(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysMenuControllerListRoutesParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultListSysMenu>(`${apiPrefix}/sys/menu/routes`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分页列出菜单树 GET /sys/menu/tree */
export async function sysMenuControllerPageTreeList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysMenuControllerPageTreeListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationSysMenu>(`${apiPrefix}/sys/menu/tree`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
